<template>
  <view class="my">
    <view>会员信息：{{ memberStore.profile }}</view>
    <button @tap="memberStore.setProfile({
      nickname:'一马当先',
      token:'1234567',
      })" size="mini" plain type="primary">
      保存会员信息
    </button>
    <button @tap="memberStore.clearProfile()" size="mini" plain type="warn">清理用户信息</button>
    <button
      @tap="getData" size="mini" plain type="primary"
    >
      测试请求
    </button>
  </view>
</template>

<script lang="ts" setup>
  import { useMemberStore } from "@/stores";
  import {http} from '@/utils/http';

  const memberStore = useMemberStore();
  // 测试请求
  const getData = async ()=>{
    const res = await http<string[]>({
      method:'GET',
      url:'/home/banner',
      header:{},
    })
    console.log('请求成功',res);
  }
</script>

<style scoped></style>